var mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/jiugu')
var Schema = mongoose.Schema
var userDetailSchema = new Schema({
	userName: {//昵称
		type: String,
		required: true
	},
	age: {//年龄
		type: Number,
		default: 0,
		required: true
	},
	gender: {//性别
		type: String,
		default: '1',
		required: true
	},
	imgUrl: {//头像
		type: String,
		default: '/nabi.jpg',
		required: true
	},
	email: {//邮箱
		type: String,
		required: false
	},
	integ: {//积分
		type: Object,
		default: {
			login: 0,
			post: 0,
			parise: 0,
			comment: 0
		},
		required: false
	},
	follow:[// 关注的人
		{
			type:String,
			required: true
		}
	],
	fans:[// 粉丝
		{
			type:String,
			required: true
		}
	]
})
module.exports = mongoose.model('userDetail', userDetailSchema)